package cn.wolfcode.qo;

import cn.hutool.core.date.DateUtil;
import cn.wolfcode.enums.ConsumptionReportEnum;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter
@Setter
public class ConsumptionReportQueryObject extends QueryObject {
    private String groupType= ConsumptionReportEnum.BUSINESS.getValue();   //分组类型
    private Long businessId;  //门店
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date startTime;   //开始时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date endTime;  //结束时间
    private Integer status;  //结算单状态
    private Boolean appointmentType;  //预约类型

    public Date getEndTime(){
        if(endTime!=null){
            return DateUtil.endOfDay(endTime);
        }
        return null;
    }
}
